package com.starlink.model.util;

import com.starlink.model.dtomapper.FreeTemplateDtoMapper;
import com.starlink.model.domain.FreeTemplateDO;
import com.starlink.model.vo.FreeTemplateVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class FreeTemplateConvert {

    public static List<FreeTemplateVO> buildFreeTemplateVoList(List<FreeTemplateDO> freeTemplateDOList) {
        if (CollectionUtils.isEmpty(freeTemplateDOList)) {
            return Lists.newArrayList();
        }
        List<FreeTemplateVO> freeTemplateVOList = new ArrayList<>();
        for (FreeTemplateDO freeTemplateDO : freeTemplateDOList) {
            freeTemplateVOList.add(FreeTemplateDtoMapper.INSTANCE.do2VO(freeTemplateDO));
        }

        return freeTemplateVOList;
    }
}
